import java.io.InputStream
import java.util
import java.util.Properties

import com.alibaba.druid.pool.DruidDataSourceFactory
import javax.sql.DataSource
import org.apache.commons.dbutils.handlers.ArrayListHandler
import org.apache.commons.dbutils.{QueryRunner, ResultSetHandler}

object Test {
  def main(args: Array[String]): Unit = {
    val p: Properties = new Properties()
    val inputStream: InputStream = this.getClass.getResourceAsStream("druid.properties")
    println(inputStream)
    p.load(inputStream)
    var dataSource: DataSource = DruidDataSourceFactory.createDataSource(p)
    val qr: QueryRunner = new QueryRunner(dataSource)
    val sql = "select * from lg_bus"
    val list = qr.query(sql, new ArrayListHandler())
  }
}
